/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager;

import entity.Category;
import iface.IManagerDisabled;
import java.util.ArrayList;

/**
 *
 * @author Noi
 */
public class DisabledCategoryManager implements IManagerDisabled<Category> {
    
    private Manager manager;
    private ArrayList<Category> alCategory;
    
    public DisabledCategoryManager(Manager manager) {
        this.manager = manager;
    }
    
    @Override
    public void add(Category obj) {
        this.alCategory.add(obj);
    }

    @Override
    public void recovery(int index) {
        Category category = (Category)this.alCategory.remove(index);
        category.setStatus(true);
        this.manager.getCategoryManager().add(category);
    }

    @Override
    public Category get(int index) {
        return this.alCategory.get(index);
    }
    
}
